package org.elanfox.intellicommunity.msg.base;

import org.elanfox.intellicommunity.common.ienum.base.CodeDescEnumHelper;
import org.elanfox.intellicommunity.common.utils.HexUtils;
import org.elanfox.intellicommunity.msg.ienum.BaseStationType;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/3/21
 */
public class MsgHelper {
    /**
     * 得到阅读器16进制的地址
     *
     * @param baseStationType
     * @param deviceAddr
     * @return
     */
    public static String getHexAddr(int baseStationType, long deviceAddr) {
        BaseStationType stationType = CodeDescEnumHelper.getEnumTypeByCode(BaseStationType.class, baseStationType);

        return stationType.getHexCode() + HexUtils.numToHex8(deviceAddr);
    }
}
